package server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import org.apache.log4j.Logger;

public class Server {
	private static ServerSocket serv;
    private static ServerThread server;
    private static final String INITIALIZED="initialized";
    private static final String CONNECTED="connected";
   private static Logger log= Logger.getLogger(Server.class);
	public static void main(String[] args) {
		try {
			serv = new ServerSocket(8071);
			System.out.println(INITIALIZED);
			while (true) {
				Socket sock = serv.accept();
				System.out.println(CONNECTED);
				server = new ServerThread(sock);
				server.start();
				
			}
		} catch (IOException e) {
			System.err.println(e);
			log.error(e);
		}
	}

}
